﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace pwdApplication
{
    class Program
    {
        static void Main(string[] args)
        {

            if (args == null || args.Length == 0)
            {
                Console.WriteLine("Please supply pwd.");
            }
            else
            {
                Console.WriteLine("SHA1 : " + HashPassword(args[0]));
            }
        }

        private static string HashPassword(string password)
        {
            byte[] passwordBytes = Encoding.Unicode.GetBytes(password);
            using (SHA1 ha = SHA1.Create())
            {
                byte[] resultBytes = ha.ComputeHash(passwordBytes);
                return Convert.ToBase64String(resultBytes);
            }
        }
    }
}
